var ele = this.current.contentWindow.getSelection().anchorNode;
if (ele) {
ele = ele.parentNode;
var style = this.current.contentWindow.getComputedStyle(ele, "");
var reg = /['"](.+)['"]\s*,\s*.+/
var fam = style.fontFamily.replace(reg, "$1").toLowerCase();
var found = false;
Array.forEach(event.target.childNodes, function (node) {
if (fam == node.value.replace(reg, "$1").toLowerCase()) {
node.setAttribute("checked", "true");
found = true;
} else
node.removeAttribute("checked");
});
}
},
selectWritingDirection: function (direction)
{
if (direction == "none") {
//this.removeTextProperty("*","dir");
} else {
this.current.contentDocument.dir = direction;
//this.setTextProperty("*", "dir", direction);
}
},
get editor() {
try {
Ci = Components.interfaces;
Cc = Components.classes;
var win = this.current.contentWindow;
var editingSession = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIEditingSession);
if (editingSession.windowIsEditable(win)) {
var editor = editingSession.getEditorForWindow(win);
var editingSession = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIEditingSession);
if (editingSession.windowIsEditable(win)) {
var editor = editingSession.getEditorForWindow(win);
return editor;
}
}
catch(ex) {}
return null;
},
removeTextProperty: function (property, attribute)
{
{
var atomService = Components.classes["@mozilla.org/atom-service;1"].